/**
 * 
 */
package cn.jhz.filesharingsystem.service;

import java.io.IOException;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.http.HttpHeaders;
import org.springframework.web.multipart.MultipartFile;

import cn.jhz.filesharingsystem.model.Pager;
import cn.jhz.filesharingsystem.model.SharedFile;
import cn.jhz.filesharingsystem.model.User;

/**
 * @author asus
 *
 */
public interface SharedFileService extends BaseService<SharedFile> {
	/**
	  * 获取所有文件信息
	 * @return
	 */
	public List<SharedFile> getAllFile();
	
	/**
	  * 获取所有文件信息，支持分页,模糊查询
	 * @return
	 */
	public Pager<SharedFile> getAllPagerFile(String filename, int provider, boolean state);
	
	public void saveFile(User provider, Integer state,String notes, MultipartFile uploadfile) throws IOException;

	public void deleteRecord(SharedFile deletefile) throws IOException;
	
	public byte[] download(int id, HttpHeaders headers) throws IOException;
	
	public void download(SharedFile file, HttpServletRequest req, HttpServletResponse resp) throws IOException;

	public void updateState(Integer fileId)throws IOException;

}
